import jieba

# print(list(jieba.cut('大家好，我叫小明')))

vocab = {}  # 通过字典的特性进行去重
with open('source.txt', 'r') as file:
    for line in file:
        for word in jieba.cut(line.strip()):
            vocab[word] = 0
    for w in vocab.keys():
        print(w)

with open('Wsoure.txt', 'w') as Wsf:
    for c in vocab.keys():
        Wsf.write(c + '\n')
